<div class="container-fluid">

	<!-- affichage des messages Flash-->
	<div class="row-fluid">
		<div class="span12">
			<?php echo $this->Session->flash('auth'); ?>
			<?php echo $this->Session_gpp->flash(); ?>
	 	</div>
	</div>

	<!-- Chemin fil conducteur -->
  	<div class="row-fluid">
		<div class="span12">
			<ul class="breadcrumb">
		      	<?php 
					echo '<li>'.$this->Html->link('Applications',array('controller'=>'applications','action'=>'index')).'</span>/</span></li>';
				?>
				<?php 
					echo '<li>'.$this->Html->link(h($sonapp['Application']['name']),array('controller'=>'applications','action'=>'View',$sonapp['Application']['id'])).'</span>/</span></li>';
				?>
				<?php 
					echo '<li class="active">'.$this->Html->link(h($version['Version']['name']),array('controller'=>'versions','action'=>'View',$version['Version']['id']))."</li>";
				?>
			</ul>
		</div>
	</div>

	<!-- entete des onglets -->
	<div class="row-fluid">
		<div class="span12">
			<ul id="tab" class="nav nav-tabs">
			  <li><a href="#Version" data-toggle="tab">Version</a></li>
			  <li class="active"><a href="#Tables" data-toggle="tab">Tables</a></li>
			</ul>
	 	</div>
	</div>

	<!-- detail des onglets -->
	<div id="myTabContent" class="tab-content">
		<!-- Onglet Versions -->
	  	<div class="tab-pane fade in" id="Version">
	  		<div class="navbar"/>
				<div class="navbar-inner_gpp">
					<div class="container-fluid">
						<div class="nav-collapse">
							<div class="row-fluid">
								<div class="span2">
									<a href="../edit/<?php echo $version['Version']['id'];?>" class="btn btn-info btn-small" >
										<i class="icon-pencil icon-white"></i><?php echo __(' Version')?>
									</a>
								</div>
								<div class="span2">
									<p>
										<?php echo $this->Moninput->deleteInverse(
													__('Delete Version'),
													$version['Version']['id'], 
													'Versions',
													__('Are you sure you want to delete # '.$version['Version']['id'].'?')
												); ?>
									</p>
								</div>
								<div class="span8">
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="hero-unit">
				<dl>
					<h1><?php echo h($version['Version']['name']); ?></h1>
					&nbsp;
					<h2><?php echo h($version['Version']['description']); ?></h2>
					<h2><?php echo __('Version de l\'application'); ?>
						<?php echo $this->Html->link(h($version['Application']['name']), array('controller' => 'applications', 'action' => 'view', $version['Application']['id'])); ?>
					</h2>
				</dl>
			</div>
	  	</div>

	  	<!-- Onglet Tables -->
		<div class="tab-pane active" id="Tables">
	  		<div class="navbar"/>
				<div class="navbar-inner_gpp">
					<div class="container-fluid">
						<div class="nav-collapse">
							<div class="row-fluid">
								<div class="span2">
									<a href="../../tables/add/<?php echo $version['Version']['id'];?>" class="btn btn-primary btn-small" >
										<i class="icon-plus-sign icon-white"></i><?php echo __(' Table')?>
									</a>
								</div>
								<div class="span2">
									<a href="../../tables/import/<?php echo $version['Version']['id'];?>" class="btn btn-primary btn-small" >
										<i class="icon-download-alt icon-white"></i><?php echo __(' Import')?>
									</a>
								</div>
								<div class="span8">
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
	
			<div class="page-header">
				<?php if (!empty($lsttable)):?>
					<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
						<thead>
							<tr>
								<th width="1px"><?php echo __('Id'); ?></th>
								<th><?php echo __('Name'); ?></th>
								<th><?php echo __('Description'); ?></th>
								<th width="1px"></th>
							</tr>
						</thead>
						<tbody>	
							<?php
								$i = 0;
								foreach ($lsttable as $table): 
									$table=$table['Table'];?>
									<tr>
										<td><?php echo $table['id'];?></td>
										<td align="left"><?php echo $this->Html->link(h($table['name']),array('controller'=>'tables','action'=>'view',$table['id'], $version['Version']['id'])); ?>&nbsp;
										</td>
										<td><?php echo h($table['description']);?></td>
										<td class="center">
											<p>
												<?php echo $this->Moninput->delete(
															__('Delete'),
															array($table['id'], $version['Version']['id']),
															'Tables',
															__('Are you sure you want to delete # '.$table['id'].' '.$table['name'].'?')
														); 
												?>
											</p>
										</td>
									</tr>
								<?php endforeach; 
							?>
						</tbody>	
					</table>
				<?php endif; ?>

			</div>
		</div>
	</div>
</div>

<!-- Chargement des onglets-->
<script type="text/javascript" charset="utf-8">
  	$(function () {
    	$('.tabs a:last').tab('show');
  	})
</script>